﻿using System;
using System.Collections;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using ncp.Business;
using ncp.Business.Common;

namespace ncp.Web.handler
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class UserStatusText : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            var text = "";
            var userInfo = WebMasterCookie.GetCookie();
            if (userInfo == null)
            {
                text = @"<div class=""not-login bh-fl""><span>欢迎来到中国农业信息网</span><a href=""/login.html"">[登录]</a><a href=""/register.html"">[注册]</a></div>";
            }
            else
            {
                var shopid =CommonBll.BuildShopId(Convert.ToInt32(userInfo.Id));
                text = @"<div class=""has-login bh-fl""><span>欢迎<b>" + userInfo.UName + @"</b>来到中国农业信息网</span><a href=""/member/message/index.html"">[个人中心]</a><a onclick=""loginOut()"" href=""#"">[退出]</a></div>";
            }
            context.Response.Write(text);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
